// Learn cc.Class:
//  - https://docs.cocos.com/creator/manual/en/scripting/class.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

const {ccclass, property} = cc._decorator;
import {Gardener, GardenerWindow, IGardenerWindow} from "../gardener/GameGardener"

@ccclass
export default class UserInfoWindow extends GardenerWindow implements IGardenerWindow{

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {},

    start () {
 
    }

    // update (dt) {},

    onBtnClose_Tap(){
        Gardener.closeWindow();
    }

    onBtnNext_Tap(){
        Gardener.loadWindow(GardenerConfig.PrefabWindow.P_TREE_INFO_WINDOW,(window)=>{
            window && Gardener.openWindow(cc.instantiate(window), true);
        });
    }

    onBtnPopup_Tap(){
        Gardener.loadPopup(GardenerConfig.PrefabPopup.P_SETTINGS_POPUP,(popup)=>{
            popup && Gardener.openPopup(cc.instantiate(popup));
        });
    }

    display(){
        GameLogger.debug('user window display');
    }

    dispose(){
        GameLogger.debug('user window dispose');
    }
}
